/*
 * 创建日期 2009-12-16
 *
 * 成都天和软件公司
 * 电话：028-85425861
 * 传真：028-85425861-8008
 * 邮编：610041 
 * 版权所有
 */
package  org.fantasy.common.grid;

import java.util.List;

import  org.fantasy.common.db.Query;
import  org.fantasy.common.db.bean.Row;
import  org.fantasy.common.db.oracle.OracleQryFactory;
import  org.fantasy.common.grid.bean.Column;
import  org.fantasy.common.grid.custom.BaseCellCustom;

/**
 *  功能说明
 * @author: 王文成
 * @version: 1.0
 * @since 2009-12-16
 */
public class TestCellCustom extends BaseCellCustom {

    @Override
    public String getStyle(Row row, Column col) throws Exception {
        String colName = col.getFieldName();
        if ("charge1".equals(colName) || "charge2".equals(colName)) {
            return "color:blue;font-weight:bold;";
        }else{
            return "";
        }
    }

    @Override
    public String getValue(Row row, Column col) throws Exception {
        String colName = col.getFieldName();
        if ("charge1".equals(colName) || "charge2".equals(colName)) {
            return super.getValue(row, col) + "(元)";
        }
        return super.getValue(row, col);
    }
    
    public static void main(String[] args)throws Exception {
        OracleQryFactory qryFactory = new OracleQryFactory();
        String sql = "select * from report_test3";
        Query query = qryFactory.getQuery(sql);
        List resultList = query.list();
    }
}
